import dxRequest from "../../network/index"
Page({
  data: {
    gender: "",
    phone: "",
    user_name: "",
    region: ["湖南省", "长沙市", "长沙县"]
  },
  onSubmit(event) {
    console.log(this.data);
    console.log('表单数据：', event.detail.value);
    dxRequest('post', '/access/infoComplete', {
      openid: getApp().globalData.userInfo.openid,
      ...event.detail.value
    })
    .then(res => {
      wx.showToast({
        title: '更新成功',
      })
    })
  },
  // onNameInput(event) {
  //   this.setData({
  //     user_name: event.detail.value
  //   });
  // },
  onRegionChange(event) {
    console.log(event);
    this.setData({
      region: event.detail.value
    });
  },
  // onPhoneInput(event) {
  //   this.setData({
  //     phone: event.detail.value
  //   });
  // },
  // onGenderChange(event) {
  //   console.log(event);
  //   this.setData({
  //     gender: event.detail.value
  //   });
  // }
})
